package xyz.xpman.prisonerfitness.kit;

import android.annotation.SuppressLint;
import android.icu.text.SimpleDateFormat;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Date;

public class DateKit {
//    public static final String DEFAULT = "yyyy-MM-dd_HH-mm-ss";

    private DateKit() { }


    public static String format(Date date, String pattern) {
        @SuppressLint({"NewApi", "LocalSuppress", "SimpleDateFormat"})
        final String fmtDate = new SimpleDateFormat(pattern).format(date);
        return fmtDate;
    }


    public static String format(LocalDate date, String pattern) {
        @SuppressLint({"NewApi", "LocalSuppress"})
        String format = DateTimeFormatter.ofPattern(pattern).format(date);
        return format;
    }

}
